# define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a = 1, j = 1;
	scanf("%d", &a);
	int Sn = a;
	int sum = 0;
	for (int i = 0; i < 4; i++)
	{
		j = j * 10 + 1;
		sum = a * j;
		Sn += sum;
	}
	printf("%d\n", Sn);
}